//编写函数，将5x5的矩阵中的右上三角元素都设置成0（包括对角线），其余元素不变

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int fu0(int a[][5]);

int main()
{
        int i,j,n,a[5][5];
        srand(time(NULL));
        for (i=0;i<5;i++)
	{
		for (j=0;j<5;j++)
       		{
                	a[i][j] = rand()%100;
           	     	printf("%2d ",a[i][j]);
       		}
        	printf("\n");
	}

	printf("============================\n");

	fu0(a);

	for (i=0;i<5;i++)
        {
                for (j=0;j<5;j++)
                {
                        printf("%2d ",a[i][j]);
                }
                printf("\n");
        }
	
	return 0 ;
}
int fu0(int a[][5])
{
	int i,j;
	for (i=0;i<5;i++)
		for (j=i;j<5;j++)
			a[i][j]=0;
}


//diwutiantang@diwutiantang-VirtualBox:~/snap/lc/Dec/1219$ ./7
//41 37 39 91 69 
//40 68 19 11  4 
//68 98 51 57 84 
//96 70  2 88 36 
//50 97 86  2 56 
//============================
// 0  0  0  0  0 
//40  0  0  0  0 
//68 98  0  0  0 
//96 70  2  0  0 
//50 97 86  2  0 



